package cn.com.hfuu.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.com.hfuu.dao.roleMapper;
import cn.com.hfuu.module.role;

@Service("roleservice")
public class RoleService {
	@Autowired
	roleMapper rolemap;
	
	public List<role> selectall(Integer start, Integer limit){
		return rolemap.selectall(start,limit);
	}
	public int selectalltotal(){
		return rolemap.selectalltotal().size();
	}
	public role exitname(String roleName) {
		// TODO Auto-generated method stub
		return rolemap.selctbyname(roleName);
	}
	public void insert(cn.com.hfuu.module.role r) {
		// TODO Auto-generated method stub
		rolemap.insert(r);
	}
	 
	public role editbyid(String id) {
		// TODO Auto-generated method stub
		return rolemap.editByPrimaryKey(id);
	}
	public role exitnameedit(String roleName, String roleId) {
		// TODO Auto-generated method stub
		return rolemap.exitnameedit(roleName,roleId);
	}
	public int update(cn.com.hfuu.module.role r) {
		// TODO Auto-generated method stub
		return rolemap.updateByPrimaryKey(r);
	}
	public int delete(String[] ids) {
		// TODO Auto-generated method stub
		 return rolemap.deletes(ids);
	}
	public List<role> selectbiroleid(String[] ids) {
		// TODO Auto-generated method stub
		return rolemap.selectbyid(ids);
	}
	public List<role> selectalls() {
		// TODO Auto-generated method stub
		return rolemap.selectalls();
	}
	public List<role> selectcyyg() {
		// TODO Auto-generated method stub
		return rolemap.getcyyg();
	}
	public List<role> selectbyuser(String userId) {
		// TODO Auto-generated method stub
		return rolemap.selectbyuser(userId);
	}
	
}
